const App = {
    data() {
        return {
            tableData:[],
        }
    },
    beforeCreate() {
        function setRem() {
            const designWidth = 750; // 设计稿宽度（rpx）
            const maxWidth = 540; // 可选：限制最大宽度（如手机端常见值）
            const screenWidth = Math.min(window.innerWidth, maxWidth);
            const scale = screenWidth / designWidth;
            document.documentElement.style.fontSize = scale + 'px';
        }
        setRem();//1rem = 0.5px 对标小程序在 375px 宽的屏幕上，1rpx = 0.5px（因为 750rpx / 375px = 2）
        window.addEventListener('resize', setRem);
    },
    mounted() {
        this.getData();
    },
    methods: {
        getData(){
            $.ajax({
                headers: requestHeaders(),
                url: `${mh}/generalBusiness/generalQueryBySQLSerialNumber`,
                method: "post",
                data: {
                    SQLSerialNumber: 'f_merchant_business_mapping_blue_plate',
                    Condition: '',
                    ExtensionCondition: '',
                },
                success: (data) => {
                
                    this.tableData = data;

                },
                complete: (XMLHttpRequest) => {
                    requestPretreatment(XMLHttpRequest)
                },
            })
        },
        handle(item){
            window.location.href = './moblie3.html?Merchant_SerialNumber=' + item.Merchant_SerialNumber +'&Merchant_Category_SerialNumber=' + item.Merchant_Category_SerialNumber + '&Blue_Plate_SerialNumber=' + item.Blue_Plate_SerialNumber;
        }
    },
};

const { createApp } = Vue;
const app = createApp(App);
//这种方式是引入全部图标，无需单个引入
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
const ElMessage = ElementPlus.ElMessage;
app.use(ElementPlus, { locale: zhCn });
app.mount("#app");
